<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="prc.*"%>

<jsp:include page="top.jsp" />

<% 
	int cat = Integer.parseInt(request.getParameter("cat"));
	int forum = Integer.parseInt(request.getParameter("f"));
	Categorie categorie = ForumManagement.categorii.get(cat);
	Sectiune sectiune = categorie.sectiuni.get(forum);
%>
<a href="newthread.jsp?cat=<% out.print(cat); %>&f=<% out.print(forum); %>"><img src="./stuff/new_thread.png" /></a>
<div class="forabg">
		
		<div class="inner">
			<span class="corners-top"><span></span>
			</span>
			
			<ul class="topiclist">
				<li class="header">
					<dl class="icon">
						<dt>
							<%
								out.print(categorie.getNume()+" - "+sectiune.getNume());
							%>
						</dt>
						<dd class="topics">Creator</dd>
						<dd class="posts">Posts</dd>
						<dd class="lastpost">
							<span>Last post</span>
						</dd>
					</dl></li>
			</ul>
			<ul class="topiclist forums">
				<%
					int j;
					for (j = 0; j < sectiune.getTopicNr(); j++)  {
						Topic topic = sectiune.topicuri.get(j);
				%>
				<li class="row">
					<dl class="icon">
						<dt title="No unread posts">
							<a href="./viewthread.jsp?cat=<% out.print(cat); %>&f=<% out.print(forum); %>&t=<% out.print(topic.getID()); %>" class="forumtitle"><% out.print(topic.getTitle()); %></a><br />
							Description of your first forum.
						</dt>
						<dd class="topics">
							<% out.print(topic.getCreator()); %>
							<dfn>Creator</dfn>
						</dd>
						<dd class="posts">
							<% out.print(topic.getNrPostari()); %>
							<dfn>Posts</dfn>
						</dd>
						<dd class="lastpost">
						<%
							if(topic.getLastPoster()!=null){
						%>
							<span> <dfn>Last post</dfn> by <a
								style="color: #AA0000;" class="username-coloured"><% out.print(topic.getLastPoster()); %></a> <a
								href="./viewtopic.php?f=2&amp;p=2#p2">
							</a> </span>
						<%} else {%>
							<span> <dfn>Last post</dfn> - </span>						
						<%} %>
						</dd>
					</dl>
				<%} %>
			</ul>
		</div>

	</div>

<div id="page-body">

<jsp:include page="bottom.jsp" />